package com.example.rjxmgl.controller;

import com.example.rjxmgl.entity.dos.Leave;
import com.example.rjxmgl.form.LoginForm;
import com.example.rjxmgl.service.UserService;
import com.example.rjxmgl.utils.ResultMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Arrays;




/**
 * 用户表
 *
 * @author khai 951992121@qq.com
 * @since 1.0.0 2024-12-05
 */

//继续更新本次代码
@RestController
@RequestMapping("user")
@Tag(name = "接口信息")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    @Operation(summary = "登录")
    public ResultMessage login(@RequestBody LoginForm login) {

        return userService.login(login);

    }

    @GetMapping("/getTeacherNameById/{teacherId}")
    @Operation(summary = "通过教师id获得教师名字")
    public ResultMessage getTeacherNameById(@PathVariable("teacherId")Long teacherId){
        return userService.getTeacherNameById(teacherId);
    }


}